home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / xemacs-faq.info-2 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  42.8 KB  |  1,019 lines

  1. This is Info file ../info/xemacs-faq.info, produced by Makeinfo-1.63
  2. from the input file xemacs-faq.texi.
  3.  
  4. 
  5. File: xemacs-faq.info,  Node: 10.1.,  Next: 10.2.,  Up: 10. The mouse; cutting and pasting
  6.  
  7. 10.1. I keep hitting the middle mouse button by accident and getting stuff pasted into my buffer so how can I turn this off?
  8. ============================================================================================================================
  9.  
  10.    Here is an alternative binding, whereby the middle mouse button
  11. selects (but does not cut) the expression under the mouse. Clicking
  12. middle on a left or right paren will select to the matching one.  Note
  13. that you can use `define-key' or `global-set-key'.
  14.  
  15.      (defun Mouse-Set-Point-and-Select (event)
  16.        "Sets the point at the mouse location, then marks following form"
  17.        (interactive "@e")
  18.        (mouse-set-point event)
  19.        (mark-sexp 1)
  20.        )
  21.      (define-key global-map 'button2 'Mouse-Set-Point-and-Select)
  22.  
  23.    (Editor's Note - there is a problem with texinfo/text/html
  24. conversion, so the double at-sign should only be a single, above.  I'll
  25. fix it one of these days - AJR)
  26.  
  27. 
  28. File: xemacs-faq.info,  Node: 10.2.,  Next: 10.3.,  Prev: 10.1.,  Up: 10. The mouse; cutting and pasting
  29.  
  30. 10.2. How do I set control/meta/etc modifiers on mouse buttons?
  31. ===============================================================
  32.  
  33.    Use, for instance, `[(meta button1)]'. For example, here is a common
  34. setting for Common Lisp programmers who use the bundled ilisp package,
  35. whereby meta-button1 on a function name will find the file where the
  36. function name was defined, and put you at that location in the source
  37. file.
  38.  
  39.    [Inside a function that gets called by the lisp-mode-hook and
  40. ilisp-mode-hook]
  41.      (local-set-key [(meta button1)] 'edit-definitions-lisp)
  42.  
  43. 
  44. File: xemacs-faq.info,  Node: 10.3.,  Next: 10.4.,  Prev: 10.2.,  Up: 10. The mouse; cutting and pasting
  45.  
  46. 10.3. I do "^x ^b" to get a list of buffers and the entries get highlighted when I move the mouse over them but clicking the left mouse does not do anything.
  47. =============================================================================================================================================================
  48.  
  49.    Use the middle mouse button.
  50.  
  51. 
  52. File: xemacs-faq.info,  Node: 10.4.,  Next: 10.5.,  Prev: 10.3.,  Up: 10. The mouse; cutting and pasting
  53.  
  54. 10.4. How can I get a list of buffers to popup when I hit button 3 on the mouse?
  55. ================================================================================
  56.  
  57.    The following code will actually replace the default popup on
  58. button3:
  59.  
  60.      (defun cw-build-buffers ()
  61.        "Popup buffer menu."
  62.        (interactive "@")
  63.        (run-hooks 'activate-menubar-hook)
  64.        (popup-menu (car (find-menu-item current-menubar '("Buffers")))))
  65.      
  66.      (define-key global-map [(button3)] 'cw-build-buffers)
  67.  
  68.    (Editor's Note - there is a problem with texinfo/text/html
  69. conversion, so the double at-sign should only be a single, above.  I'll
  70. fix it one of these days - AJR)
  71.  
  72. 
  73. File: xemacs-faq.info,  Node: 10.5.,  Next: 10.6.,  Prev: 10.4.,  Up: 10. The mouse; cutting and pasting
  74.  
  75. 10.5. Why does cut-and-paste not work between XEmacs and a cmdtool?
  76. ===================================================================
  77.  
  78.    We don't know.  It's a bug.  There does seem to be a work-around,
  79. however.  Try running xclipboard first.  It appears to fix the problem
  80. even if you exit it.  (This should be mostly fixed in 19.13, but we
  81. haven't yet verified that).
  82.  
  83. 
  84. File: xemacs-faq.info,  Node: 10.6.,  Next: 10.7.,  Prev: 10.5.,  Up: 10. The mouse; cutting and pasting
  85.  
  86. 10.6.  How I can set XEmacs up so that it pastes where the cursor is _not_ where the pointer lies?
  87. ==================================================================================================
  88.  
  89.    Try adding the following to your `.emacs':
  90.  
  91.      (define-key global-map 'button2 'x-insert-selection)
  92.  
  93.    This comes from the `sample.emacs' file in `etc/', which has lots of
  94. goodies.
  95.  
  96. 
  97. File: xemacs-faq.info,  Node: 10.7.,  Next: 10.8.,  Prev: 10.6.,  Up: 10. The mouse; cutting and pasting
  98.  
  99. 10.7. How do I select a rectangular region?
  100. ===========================================
  101.  
  102.    Just select the region normally, then use the rectangle commands
  103. (e.g.  `kill-rectangle') on it.  The region does not highlight as a
  104. rectangle, but the commands work just fine.
  105.  
  106.    To actually sweep out rectangular regions with the mouse do the
  107. following:
  108.  
  109.      (setq mouse-track-rectangle-p t)
  110.  
  111. 
  112. File: xemacs-faq.info,  Node: 10.8.,  Prev: 10.7.,  Up: 10. The mouse; cutting and pasting
  113.  
  114. 10.8. Why does M-w take so long?
  115. ================================
  116.  
  117.    It actually doesn't.  It leaves the region visible for a second so
  118. that you can see what area is being yanked.  If you start working,
  119. though, it will immediately complete its operation.  In other words, it
  120. will only delay for a second if you let it.
  121.  
  122. 
  123. File: xemacs-faq.info,  Node: 11. Highlighting,  Next: 12. The menubar and toolbar,  Prev: 10. The mouse; cutting and pasting,  Up: Top
  124.  
  125. 11. Highlighting
  126. ****************
  127.  
  128. * Menu:
  129.  
  130. * 11.1.::          11.1. How can I highlight selections?
  131. * 11.2.::          11.2. How do I get a pending-delete type of behavior?
  132. * 11.3.::          11.3. I do not like my text highlighted while I am doing isearch as I am not able to see whats underneath.  How do I turn it off?
  133. * 11.4.::          11.4. The text gets highlighted when I do C-x C-p (mark-page).  Is there a way to turn this feature off?
  134.  
  135. 
  136. File: xemacs-faq.info,  Node: 11.1.,  Next: 11.2.,  Up: 11. Highlighting
  137.  
  138. 11.1. How can I highlight selections?
  139. =====================================
  140.  
  141.    Use zmacs mode.  This mode allows for what some might call gratuitous
  142. highlighting for selected regions (either by setting mark or by using
  143. the mouse).  To use, add the following line to your `.emacs' file:
  144.  
  145.      (setq zmacs-regions t)
  146.  
  147.    This is the default behavior.
  148.  
  149. 
  150. File: xemacs-faq.info,  Node: 11.2.,  Next: 11.3.,  Prev: 11.1.,  Up: 11. Highlighting
  151.  
  152. 11.2. How do I get a pending-delete type of behavior?
  153. =====================================================
  154.  
  155.    "Pending delete" is what happens when you select a region (with the
  156. mouse or keyboard) and you press a key to replace the selected region by
  157. the key you typed.  Usually backspace kills the selected region.
  158.  
  159.    To get this behavior, add the following line to your `.emacs' file:
  160.  
  161.      (require 'pending-del)
  162.  
  163. 
  164. File: xemacs-faq.info,  Node: 11.3.,  Next: 11.4.,  Prev: 11.2.,  Up: 11. Highlighting
  165.  
  166. 11.3. I do not like my text highlighted while I am doing isearch as I am not able to see whats underneath.  How do I turn it off?
  167. =================================================================================================================================
  168.  
  169.      (setq isearch-highlight nil)
  170.  
  171.    Note also that isearch-highlight affects query-replace and ispell.
  172. Instead of disabling isearch-highlight you may find that a better
  173. solution consists of customizing the 'isearch' face.
  174.  
  175. 
  176. File: xemacs-faq.info,  Node: 11.4.,  Prev: 11.3.,  Up: 11. Highlighting
  177.  
  178. 11.4. The text gets highlighted when I do C-x C-p (mark-page).  Is there a way to turn this feature off?
  179. ========================================================================================================
  180.  
  181.      (setq zmacs-regions nil)
  182.  
  183. 
  184. File: xemacs-faq.info,  Node: 12. The menubar and toolbar,  Next: 13. Scrollbars,  Prev: 11. Highlighting,  Up: Top
  185.  
  186. 12. The menubar and toolbar
  187. ***************************
  188.  
  189. * Menu:
  190.  
  191. * 12.1.::          12.1. How do I get rid of the menu (or menubar) ?
  192. * 12.2.::          12.2. Can I customize the basic menubar?
  193. * 12.3.::          12.3. What controls how many buffers are listed in the menu "Buffers" list?
  194. * 12.4.::          12.4. I am trying to use a resource like `Emacs*menubar*font' to set the font of the menubar but it's not working.
  195.  
  196. 
  197. File: xemacs-faq.info,  Node: 12.1.,  Next: 12.2.,  Up: 12. The menubar and toolbar
  198.  
  199. 12.1. How do I get rid of the menu (or menubar) ?
  200. =================================================
  201.  
  202.    Answer: To get rid of the menubar, add to `.emacs':
  203.  
  204.      (set-menubar nil)
  205.  
  206. 
  207. File: xemacs-faq.info,  Node: 12.2.,  Next: 12.3.,  Prev: 12.1.,  Up: 12. The menubar and toolbar
  208.  
  209. 12.2. Can I customize the basic menubar?
  210. ========================================
  211.  
  212.    For an extensive menubar, add the line
  213.  
  214.      (load "big-menubar")
  215.  
  216.    to your `.emacs' file.  If you'd like to write your own, this file
  217. provides a good set of examples to start from:
  218.  
  219.      lisp/packages/big-menubar.el
  220.  
  221.    (starting from your system XEmacs installation directory).
  222.  
  223. 
  224. File: xemacs-faq.info,  Node: 12.3.,  Next: 12.4.,  Prev: 12.2.,  Up: 12. The menubar and toolbar
  225.  
  226. 12.3. What controls how many buffers are listed in the menu "Buffers" list?
  227. ===========================================================================
  228.  
  229.    Add the following to your `.emacs', modified as needed:
  230.  
  231.      (setq buffers-menu-max-size 20)
  232.  
  233.    If you do not want a limit, try
  234.  
  235.      (setq buffers-menu-max-size nil)
  236.  
  237. 
  238. File: xemacs-faq.info,  Node: 12.4.,  Prev: 12.3.,  Up: 12. The menubar and toolbar
  239.  
  240. 12.4. I am trying to use a resource like `Emacs*menubar*font' to set the font of the menubar but it's not working.
  241. ==================================================================================================================
  242.  
  243.    If you are using the real Motif menubar, this resource is not
  244. recognized; you have to say
  245.  
  246.      Emacs*menubar*fontList: FONT
  247.  
  248.    If you are using the Lucid menubar, the former resource will be
  249. recognized only if the latter resource is unset.  This means that the
  250. resource
  251.  
  252.      *fontList: FONT
  253.  
  254.    will override
  255.  
  256.      Emacs*menubar*font: FONT
  257.  
  258.    even though the latter is more specific.
  259.  
  260. 
  261. File: xemacs-faq.info,  Node: 13. Scrollbars,  Next: 14. Frame Geometry,  Prev: 12. The menubar and toolbar,  Up: Top
  262.  
  263. 13. Scrollbars
  264. **************
  265.  
  266. * Menu:
  267.  
  268. * 13.1.::          13.1. How can I disable the scrollbar?
  269. * 13.2.::          13.2. How can one use resources to change scrollbar colors?
  270. * 13.3.::          13.3. When I move the scrollbar in an XEmacs window, it moves the point as well, which should not be the default behavior.  Is this a bug or a feature?  Can I disable it?
  271.  
  272. 
  273. File: xemacs-faq.info,  Node: 13.1.,  Next: 13.2.,  Up: 13. Scrollbars
  274.  
  275. 13.1. How can I disable the scrollbar?
  276. ======================================
  277.  
  278.    To turn disable them for all frames, add the following line to your
  279. `.Xdefaults':
  280.  
  281.      Emacs.scrollBarWidth:  0
  282.  
  283.    To turn the scrollbar off on a per-frame basis, use the following
  284. function:
  285.  
  286.      (set-specifier scrollbar-width (cons (selected-frame) 0))
  287.  
  288.    You can actually turn the scrollbars on at any level you want by
  289. substituting for (selected-frame) in the above command.  For example, to
  290. turn the scrollbars off only in a single buffer:
  291.  
  292.      (set-specifier scrollbar-width (cons (current-buffer) 0))
  293.  
  294. 
  295. File: xemacs-faq.info,  Node: 13.2.,  Next: 13.3.,  Prev: 13.1.,  Up: 13. Scrollbars
  296.  
  297. 13.2. How can one use resources to change scrollbar colors?
  298. ===========================================================
  299.  
  300.    Here's a recap of how to use resources to change your scrollbar
  301. colors:
  302.  
  303.      ! Motif scrollbars
  304.      
  305.      Emacs*XmScrollBar.Background: skyblue
  306.      Emacs*XmScrollBar.troughColor: lightgray
  307.      
  308.      ! Athena scrollbars
  309.      
  310.      Emacs*Scrollbar.Foreground: skyblue
  311.      Emacs*Scrollbar.Background: lightgray
  312.  
  313.    Note the capitalization of `Scrollbar' for the Athena widget.
  314.  
  315. 
  316. File: xemacs-faq.info,  Node: 13.3.,  Prev: 13.2.,  Up: 13. Scrollbars
  317.  
  318. 13.3. When I move the scrollbar in an XEmacs window, it moves the point as well, which should not be the default behavior.  Is this a bug or a feature?  Can I disable it?
  319. ==========================================================================================================================================================================
  320.  
  321.    The current behavior is a feature, not a bug.  Point remains at the
  322. same buffer position as long as that position does not scroll off the
  323. screen.  In that event, point will end up in either the upper-left or
  324. lower-left hand corner.
  325.  
  326. 
  327. File: xemacs-faq.info,  Node: 14. Frame Geometry,  Next: 15. Window/icon title; window manager problems,  Prev: 13. Scrollbars,  Up: Top
  328.  
  329. 14. Frame Geometry
  330. ******************
  331.  
  332. * Menu:
  333.  
  334. * 14.1.::          14.1. In Lucid Emacs 19.6 I did `(set-screen-width CHARACTERS)' and `(set-screen-height LINES)' in my `.emacs' instead of specifying `Emacs*EmacsScreen.geometry' in my `.Xdefaults' but this does not work in XEmacs 19.13.
  335. * 14.2.::          14.2. In XEmacs 19.11 I specified `Emacs*EmacsScreen.geometry' in my `.emacs' but this does not work in XEmacs 19.13.
  336.  
  337. 
  338. File: xemacs-faq.info,  Node: 14.1.,  Next: 14.2.,  Up: 14. Frame Geometry
  339.  
  340. 14.1. In Lucid Emacs 19.6 I did `(set-screen-width CHARACTERS)' and `(set-screen-height LINES)' in my `.emacs' instead of specifying `Emacs*EmacsScreen.geometry' in my `.Xdefaults' but this does not work in XEmacs 19.13.
  341. ============================================================================================================================================================================================================================
  342.  
  343.    These two functions now take frame arguments:
  344.  
  345.      (set-frame-width (selected-frame) CHARACTERS)
  346.      (set-frame-height (selected-frame) LINES)
  347.  
  348. 
  349. File: xemacs-faq.info,  Node: 14.2.,  Prev: 14.1.,  Up: 14. Frame Geometry
  350.  
  351. 14.2. In XEmacs 19.11 I specified `Emacs*EmacsScreen.geometry' in my `.emacs' but this does not work in XEmacs 19.13.
  352. =====================================================================================================================
  353.  
  354.    We have switched from using the term 'screen' to using the term
  355. 'frame'.  The correct entry for your `.Xdefaults' is now:
  356.  
  357.      Emacs*EmacsFrame.geometry
  358.  
  359. 
  360. File: xemacs-faq.info,  Node: 15. Window/icon title; window manager problems,  Next: 16. Editing source code (C mode; Lisp mode; etc.),  Prev: 14. Frame Geometry,  Up: Top
  361.  
  362. 15. Window/icon title; window manager problems
  363. **********************************************
  364.  
  365. * Menu:
  366.  
  367. * 15.1.::          15.1. How can I get the icon to just say `XEmacs' and not include the name of the current file in it?
  368. * 15.2.::          15.2. How can I have the window title area display the full directory/name of the current buffer file and not just the name?
  369. * 15.3.::          15.3. When I run `xterm -name junk' I get an xterm whose class name according to xprop, is `junk'.  This is the way it's supposed to work, I think.  When I run `xemacs -name junk' the class name is not set to `junk'.  It's still `emacs'.  What does `xemacs -name' really do?  The reason I ask is that my window manager (fvwm) will make a window sticky and I use XEmacs to read my mail.  I want that XEmacs window to be sticky, without having to use the window manager's function to set the window sticky.  What gives?
  370.  
  371. 
  372. File: xemacs-faq.info,  Node: 15.1.,  Next: 15.2.,  Up: 15. Window/icon title; window manager problems
  373.  
  374. 15.1. How can I get the icon to just say `XEmacs' and not include the name of the current file in it?
  375. =====================================================================================================
  376.  
  377.    Add the following line to your `.emacs' file:
  378.  
  379.      (setq frame-icon-title-format "XEmacs")
  380.  
  381. 
  382. File: xemacs-faq.info,  Node: 15.2.,  Next: 15.3.,  Prev: 15.1.,  Up: 15. Window/icon title; window manager problems
  383.  
  384. 15.2. How can I have the window title area display the full directory/name of the current buffer file and not just the name?
  385. ============================================================================================================================
  386.  
  387.    Add the following line to your `.emacs' file:
  388.  
  389.      (setq frame-title-format "%S: %f")
  390.    A more sophisticated title might be:
  391.  
  392.      (setq frame-title-format
  393.        '("%S: " (buffer-file-name "%f" (dired-directory dired-directory "%b"))))
  394.  
  395.    That is, use the file name, or the dired-directory, or the buffer
  396. name.
  397.  
  398. 
  399. File: xemacs-faq.info,  Node: 15.3.,  Prev: 15.2.,  Up: 15. Window/icon title; window manager problems
  400.  
  401. 15.3. When I run `xterm -name junk' I get an xterm whose class name according to xprop, is `junk'.  This is the way it's supposed to work, I think.  When I run `xemacs -name junk' the class name is not set to `junk'.  It's still `emacs'.  What does `xemacs -name' really do?  The reason I ask is that my window manager (fvwm) will make a window sticky and I use XEmacs to read my mail.  I want that XEmacs window to be sticky, without having to use the window manager's function to set the window sticky.  What gives?
  402. =====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
  403.  
  404.    `xemacs -name' sets the application-name for the program (that is,
  405. the thing which normally comes from `argv[0]'.)  Using `-name' is the
  406. same as making a copy of the executable with that new name.  The
  407. WM_CLASS property on each frame is set to the frame-name, and the
  408. application-class.  So, if you did `xemacs -name FOO' and then created
  409. a frame named `BAR', you'd get an X window with WM_CLASS = `( "BAR",
  410. "Emacs")'.  However, the resource hierarchy for this widget would be
  411.  
  412.      Name:    FOO  .shell.       .pane        .BAR
  413.      Class:   Emacs.TopLevelShell.XmMainWindow.EmacsFrame
  414.  
  415.    instead of the default
  416.  
  417.      Name:    xemacs.shell.       .pane        .emacs
  418.      Class:   Emacs .TopLevelShell.XmMainWindow.EmacsFrame
  419.  
  420.    It is arguable that the first element of WM_CLASS should be set to
  421. the application-name instead of the frame-name, but I think that's less
  422. flexible, since it does not give you the ability to have multiple
  423. frames with different WM_CLASS properties.  Another possibility would
  424. be for the default frame name to come from the application name instead
  425. of simply being `emacs'.  However, at this point, making that change
  426. would be troublesome: it would mean that many users would have to make
  427. yet another change to their resource files (since the default frame
  428. name would suddenly change from `emacs' to `xemacs', or whatever the
  429. executable happened to be named), so we'd rather avoid it.
  430.  
  431.    To make a frame with a particular name use:
  432.  
  433.      (make-frame '((name . "the-name")))
  434.  
  435. 
  436. File: xemacs-faq.info,  Node: 16. Editing source code (C mode; Lisp mode; etc.),  Next: 17. Text mode,  Prev: 15. Window/icon title; window manager problems,  Up: Top
  437.  
  438. 16. Editing source code (C mode; Lisp mode; etc.)
  439. *************************************************
  440.  
  441. * Menu:
  442.  
  443. * 16.1.::          16.1. How can I do source code highlighting using font-lock?
  444. * 16.2.::          16.2. How do you arrange it so that XEmacs indents all the clauses of a Common Lisp `if' the same amount instead of indenting the 3rd clause differently from the first two?
  445. * 16.3.::          16.3. I do not like cc-mode.  How do I use the old c-mode?
  446. * 16.4.::          16.4. When I try to edit a postscript file it gets stuck saying:  fontifying 'filename' (regexps....) and it just sits there. If I press ctrl-c in the window where XEmacs was started, it suddenly becomes alive again.
  447. * 16.5.::          16.5.  Does anyone know how to get the "More" Syntax Highlighting on by default?
  448.  
  449. 
  450. File: xemacs-faq.info,  Node: 16.1.,  Next: 16.2.,  Up: 16. Editing source code (C mode; Lisp mode; etc.)
  451.  
  452. 16.1. How can I do source code highlighting using font-lock?
  453. ============================================================
  454.  
  455.    For most modes, font-lock is already set up and just needs to be
  456. turned on.  This can be done by
  457.  
  458.      M-x font-lock-mode
  459.  
  460.    or by having XEmacs automatically start it by adding lines like
  461.  
  462.      (add-hook 'emacs-lisp-mode-hook    'turn-on-font-lock)
  463.      (add-hook 'dired-mode-hook    'turn-on-font-lock)
  464.  
  465.    to your `.emacs'.  See the file `etc/sample.emacs' for more examples.
  466.  
  467. 
  468. File: xemacs-faq.info,  Node: 16.2.,  Next: 16.3.,  Prev: 16.1.,  Up: 16. Editing source code (C mode; Lisp mode; etc.)
  469.  
  470. 16.2. How do you arrange it so that XEmacs indents all the clauses of a Common Lisp `if' the same amount instead of indenting the 3rd clause differently from the first two?
  471. ============================================================================================================================================================================
  472.  
  473.    One way is to add, to `.emacs':
  474.  
  475.      (put 'if 'lisp-indent-function nil)
  476.  
  477.    However, note that the package `cl-indent.el' that comes with XEmacs
  478. sets up this kind of indentation by default.  `cl-indent' also knows
  479. about many other CL-specific forms.  To use `cl-indent', one can do
  480. this:
  481.  
  482.      (load "cl-indent")
  483.      (setq lisp-indent-function (function common-lisp-indent-function))
  484.  
  485.    One can also customize `cl-indent.el' so it mimics the default `if'
  486. indentation (`then' indented more than the `else'). Here's how:
  487.  
  488.      (put 'if 'common-lisp-indent-function '(nil nil &body))
  489.  
  490.    Also, a new version (1.2) of `cl-indent.el' was posted to
  491. `comp.emacs.xemacs' on 12/9/94. This version includes more
  492. documentation than previous versions.  This may prove useful if you
  493. need to customize any indent-functions.  The post can be retrieved by
  494. searching the XEmacs mail archives.
  495.  
  496. 
  497. File: xemacs-faq.info,  Node: 16.3.,  Next: 16.4.,  Prev: 16.2.,  Up: 16. Editing source code (C mode; Lisp mode; etc.)
  498.  
  499. 16.3. I do not like cc-mode.  How do I use the old c-mode?
  500. ==========================================================
  501.  
  502.    Well, first off, consider if you really want to do this.  cc-mode is
  503. much more powerful than the old c-mode.  But if you still insist, add
  504. the following lines to your `.emacs':
  505.  
  506.      (fmakunbound 'c-mode)
  507.      (makunbound 'c-mode-map)
  508.      (fmakunbound 'c++-mode)
  509.      (makunbound 'c++-mode-map)
  510.      (makunbound 'c-style-alist)
  511.      (load-library "old-c-mode")
  512.      (load-library "old-c++-mode")
  513.  
  514.    This must be done before any other reference is made to either c-mode
  515. or c++-mode.
  516.  
  517. 
  518. File: xemacs-faq.info,  Node: 16.4.,  Next: 16.5.,  Prev: 16.3.,  Up: 16. Editing source code (C mode; Lisp mode; etc.)
  519.  
  520. 16.4. When I try to edit a postscript file it gets stuck saying:  fontifying 'filename' (regexps....) and it just sits there. If I press ctrl-c in the window where XEmacs was started, it suddenly becomes alive again.
  521. ========================================================================================================================================================================================================================
  522.  
  523.    This was caused by a bug in the Postscript font-lock regular
  524. expressions.  It should be fixed in 19.13.  For earlier versions of
  525. XEmacs, have a look at your `.emacs' file.  You will probably have a
  526. line like:
  527.  
  528.      (add-hook 'postscript-mode-hook    'turn-on-font-lock)
  529.  
  530.    Take it out, restart XEmacs, and it won't try to fontify your
  531. postscript files anymore.
  532.  
  533. 
  534. File: xemacs-faq.info,  Node: 16.5.,  Prev: 16.4.,  Up: 16. Editing source code (C mode; Lisp mode; etc.)
  535.  
  536. 16.5.  Does anyone know how to get the "More" Syntax Highlighting on by default?
  537. ================================================================================
  538.  
  539.    For C, C++, and Lisp, you can try adding the following to your
  540. `.emacs' file:
  541.  
  542.      (setq c-font-lock-keywords c-font-lock-keywords-2)
  543.      (setq c++-font-lock-keywords c++-font-lock-keywords-2)
  544.      (setq lisp-font-lock-keywords lisp-font-lock-keywords-2)
  545.  
  546. 
  547. File: xemacs-faq.info,  Node: 17. Text mode,  Next: 18. Shell mode,  Prev: 16. Editing source code (C mode; Lisp mode; etc.),  Up: Top
  548.  
  549. 17. Text mode
  550. *************
  551.  
  552. * Menu:
  553.  
  554. * 17.1.::          17.1. How can I enable auto-indent?
  555. * 17.2.::          17.2. How can I get XEmacs to come up in text mode (auto-fill) by default?
  556.  
  557. 
  558. File: xemacs-faq.info,  Node: 17.1.,  Next: 17.2.,  Up: 17. Text mode
  559.  
  560. 17.1. How can I enable auto-indent?
  561. ===================================
  562.  
  563.    Put the following line in your `.emacs'.
  564.  
  565.      (setq indent-line-function 'indent-relative-maybe)
  566.  
  567.    If you want to get fancy, try `filladapt' and `fa-extras', available
  568. from the Emacs Lisp Archive at Ohio State University.  Get them at URL:
  569.  
  570.      ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages
  571.  
  572. 
  573. File: xemacs-faq.info,  Node: 17.2.,  Prev: 17.1.,  Up: 17. Text mode
  574.  
  575. 17.2. How can I get XEmacs to come up in text mode (auto-fill) by default?
  576. ==========================================================================
  577.  
  578.    Try the following lisp in your `.emacs' file
  579.  
  580.      (setq default-major-mode 'text-mode)
  581.      (setq text-mode-hook 'turn-on-auto-fill)
  582.  
  583.    WARNING: note that changing default-major-mode from fundamental-mode
  584. can break a large amount of built-in code that expects newly created
  585. buffers to be in fundamental-mode.  (Changing from fundamental-mode to
  586. auto-fill text-mode might not wreak too much havoc, but changing to
  587. something more exotic like a lisp-mode would break many Emacs packages.
  588.  
  589.    Note that Emacs defaultly starts up in buffer *scratch* in
  590. initial-major-mode, which defaults to lisp-interaction-mode. Thus
  591. adding the following form to your Emacs init file will cause the
  592. initial *scratch* buffer to be put into auto-fill'ed text-mode.
  593.  
  594.      (setq initial-major-mode
  595.            (function (lambda ()
  596.              (text-mode)
  597.              (turn-on-auto-fill))))
  598.  
  599.    Note that after your init file is loaded, if inhibit-startup-message
  600. is null (the default) and the startup buffer is *scratch* then the
  601. startup message will be inserted into *scratch*; it will be removed
  602. after a timeout by erasing the entire *scratch* buffer. Keep in mind
  603. this default usage of *scratch* if you desire any prior manipulation of
  604. *scratch* from within your Emacs init file. In particular, anything you
  605. insert into *scratch* from your init file will be later erased.  Also,
  606. if you change the mode of *scratch* be sure that this will not
  607. interfere with possible later insertion of the startup message (e.g. if
  608. you put *scratch* into a nonstandard mode that has automatic font lock
  609. rules, then the startup message might get fontified in a strange
  610. foreign manner, e.g. as code in some programming language).
  611.  
  612. 
  613. File: xemacs-faq.info,  Node: 18. Shell mode,  Next: 19. Mail; VM; GNUS; BBDB; and related,  Prev: 17. Text mode,  Up: Top
  614.  
  615. 18. Shell mode
  616. **************
  617.  
  618. * Menu:
  619.  
  620. * 18.1.::          18.1. How do I start up a second shell buffer?
  621. * 18.2.::          18.2. I'm using the Emacs `M-x shell' function, and I would like to invoke and use a telnet session within it.  Everything works fine except that now all ^M's are filtered out by Emacs.  Fixes?
  622.  
  623. 
  624. File: xemacs-faq.info,  Node: 18.1.,  Next: 18.2.,  Up: 18. Shell mode
  625.  
  626. 18.1. How do I start up a second shell buffer?
  627. ==============================================
  628.  
  629.    In the *shell* buffer:
  630.  
  631.      M-x rename-buffer RET *shell-1* RET
  632.      M-x shell RET
  633.  
  634.    This will then start a second shell.  The key is that no buffer named
  635. *shell* can exist.  It might be preferable to use `M-x rename-uniquely'
  636. to rename the *shell* buffer instead of `M-x rename-buffer'.
  637.  
  638. 
  639. File: xemacs-faq.info,  Node: 18.2.,  Prev: 18.1.,  Up: 18. Shell mode
  640.  
  641. 18.2. I'm using the Emacs `M-x shell' function, and I would like to invoke and use a telnet session within it.  Everything works fine except that now all ^M's are filtered out by Emacs.  Fixes?
  642. =================================================================================================================================================================================================
  643.  
  644.    Use `M-x rsh' or `M-x telnet' to open remote sessions rather than
  645. doing rsh or telnet within the local shell buffer.
  646.  
  647. 
  648. File: xemacs-faq.info,  Node: 19. Mail; VM; GNUS; BBDB; and related,  Next: 20. Printing,  Prev: 18. Shell mode,  Up: Top
  649.  
  650. 19. Mail; VM; GNUS; BBDB; and related
  651. *************************************
  652.  
  653. * Menu:
  654.  
  655. * 19.1.::          19.1. How and where I am suppose to set the face attributes for customizing the appearance of messages (i.e. for VM)?
  656. * 19.2.::          19.2. I seem to have heard that there's a package distributed with XEmacs which will use the echo area to notify you of incoming mail in a rather configurable way (multiple spool files, different actions for different files).  What and where is it?
  657. * 19.3.::          19.3. Is there any way to add more faces and regexps to GNUS without hacking gnus.el?
  658. * 19.4.::          19.4. What is BBDB?
  659. * 19.5.::          19.5. I noticed that BBDB evokes an XEmacs bug; is there a fix?
  660. * 19.6.::          19.6. I'm getting the error 'Wrong type argument: listp :-pos' when I try to start BBDB.  What do I do?
  661. * 19.7.::          19.7. I'm getting the error 'movemail: Permission denied' when I try and start VM.  What do I do?
  662.  
  663. 
  664. File: xemacs-faq.info,  Node: 19.1.,  Next: 19.2.,  Up: 19. Mail; VM; GNUS; BBDB; and related
  665.  
  666. 19.1. How and where I am suppose to set the face attributes for customizing the appearance of messages (i.e. for VM)?
  667. =====================================================================================================================
  668.  
  669.    Suppose you want to use:
  670.  
  671.      (set-face-font 'message-highlighted-header-contents
  672.                     "-adobe-courier-bold-r-normal--12*")
  673.      (set-face-foreground 'message-headers "darkslateblue")
  674.      (set-face-foreground 'message-header-contents "brown")
  675.      (set-face-foreground 'message-highlighted-header-contents "black")
  676.      (set-face-foreground 'message-cited-text "darkgreen")
  677.  
  678.    Well, this should work, provided that `(require 'highlight-headers)'
  679. is executed first.  Also, highlight-headers is self-contained and you
  680. don't need to turn on font-lock mode.
  681.  
  682. 
  683. File: xemacs-faq.info,  Node: 19.2.,  Next: 19.3.,  Prev: 19.1.,  Up: 19. Mail; VM; GNUS; BBDB; and related
  684.  
  685. 19.2.  I seem to have heard that there's a package distributed with XEmacs which will use the echo area to notify you of incoming mail in a rather configurable way (multiple spool files, different actions for different files).  What and where is it?
  686. =========================================================================================================================================================================================================================================================
  687.  
  688.    It's called reportmail.  Add the following to your `.emacs':
  689.  
  690.      (load-library "reportmail")
  691.  
  692. 
  693. File: xemacs-faq.info,  Node: 19.3.,  Next: 19.4.,  Prev: 19.2.,  Up: 19. Mail; VM; GNUS; BBDB; and related
  694.  
  695. 19.3.  Is there any way to add more faces and regexps to GNUS without hacking gnus.el?
  696. ======================================================================================
  697.  
  698.    You can try the folowing elisp:
  699.  
  700.      (add-hook 'gnus-startup-hook
  701.                '(lambda ()
  702.                    (font-lock-mode)
  703.                    (set-face-foreground 'message-headers "red")
  704.                    (set-face-foreground 'message-header-contents "orange")
  705.                    (set-face-foreground 'message-cited-text "blue")))
  706.  
  707. 
  708. File: xemacs-faq.info,  Node: 19.4.,  Next: 19.5.,  Prev: 19.3.,  Up: 19. Mail; VM; GNUS; BBDB; and related
  709.  
  710. 19.4.  What is BBDB?
  711. ====================
  712.  
  713.    BBDB is the Big Brother Database, written by Jamie Zawinski
  714. <jwz@netscape.com>.  It interfaces to VM, mh-e, and GNUS and
  715. conveniently snarfs information about people and other things from
  716. articles and messages that go by.
  717.  
  718.    BBDB is available from the elisp archive
  719.  
  720.      archive.cis.ohio-state.edu:/pub/gnu/emacs/elisp-archive
  721.  
  722.    BBDB has a mailing list devoted to it:
  723.  
  724.      info-bbdb@cs.uiuc.edu
  725.  
  726.    This mailing list is archived at
  727.  
  728.      ftp.cs.uiuc.edu:/pub/bbdb
  729.  
  730. 
  731. File: xemacs-faq.info,  Node: 19.5.,  Next: 19.6.,  Prev: 19.4.,  Up: 19. Mail; VM; GNUS; BBDB; and related
  732.  
  733. 19.5. I noticed that BBDB evokes an XEmacs bug; is there a fix?
  734. ===============================================================
  735.  
  736.    This worked for me:
  737.  
  738.      (setq bbdb-electric-p nil)
  739.  
  740. 
  741. File: xemacs-faq.info,  Node: 19.6.,  Next: 19.7.,  Prev: 19.5.,  Up: 19. Mail; VM; GNUS; BBDB; and related
  742.  
  743. 19.6. I'm getting the error 'Wrong type argument: listp :-pos' when I try to start BBDB.  What do I do?
  744. =======================================================================================================
  745.  
  746.    Discard the copy of mail-extr.el that came with bbdb.
  747.  
  748.    XEmacs 19.12 made the change that you cannot change the value of
  749. interned symbols whose names begin with a colon.  The mail-extr.el
  750. that's distributed with 19.12+ is fixed to live with this restriction,
  751. but old copies of mail-extr.el will bomb.
  752.  
  753. 
  754. File: xemacs-faq.info,  Node: 19.7.,  Prev: 19.6.,  Up: 19. Mail; VM; GNUS; BBDB; and related
  755.  
  756. 19.7. I'm getting the error 'movemail: Permission denied' when I try and start VM.  What do I do?
  757. =================================================================================================
  758.  
  759.    Execute the following two commands.  movemail is normally located in
  760. the XEmacs install tree at `.../lib/xemacs-19.13/${arch}/movemail'.
  761.  
  762.              chgrp mail movemail
  763.              chmod 2555 movemail
  764.  
  765. 
  766. File: xemacs-faq.info,  Node: 20. Printing,  Next: 21. Gnuserv,  Prev: 19. Mail; VM; GNUS; BBDB; and related,  Up: Top
  767.  
  768. 20. Printing
  769. ************
  770.  
  771. * Menu:
  772.  
  773. * 20.1.::          20.1. Font-lock looks nice.  How can I print (WYSIWYG) the highlighted document?
  774. * 20.2.::          20.2. My printer is a Postscript printer and `lpr' only works for Postscript files, so how do I get `M-x lpr-region' and `M-x lpr-buffer' to work?
  775.  
  776. 
  777. File: xemacs-faq.info,  Node: 20.1.,  Next: 20.2.,  Up: 20. Printing
  778.  
  779. 20.1. Font-lock looks nice.  How can I print (WYSIWYG) the highlighted document?
  780. ================================================================================
  781.  
  782.    The package ps-print.el, which is now included with XEmacs, provides
  783. the ability to do this.  It contains complete instructions on its use:
  784.  
  785.      <xemacs_src_root>/lisp/packages/ps-print.el
  786.  
  787. 
  788. File: xemacs-faq.info,  Node: 20.2.,  Prev: 20.1.,  Up: 20. Printing
  789.  
  790. 20.2. My printer is a Postscript printer and `lpr' only works for Postscript files, so how do I get `M-x lpr-region' and `M-x lpr-buffer' to work?
  791. ==================================================================================================================================================
  792.  
  793.      (setq lpr-command "COMMAND TO PRINT TEXT FILES")
  794.  
  795.    Please don't forget to replace COMMAND TO PRINT TEXT FILES with the
  796. actual command (`enscript', `nenscript', etc.)!
  797.  
  798. 
  799. File: xemacs-faq.info,  Node: 21. Gnuserv,  Next: 22. Miscellaneous,  Prev: 20. Printing,  Up: Top
  800.  
  801. 21. Gnuserv
  802. ***********
  803.  
  804. * Menu:
  805.  
  806. * 21.1.::          21.1. How do I disable gnuserv from opening a new frame?
  807. * 21.2.::          21.2. What do I do to start the gnuserv server so that each subseqeuent XEmacs is a client?
  808.  
  809. 
  810. File: xemacs-faq.info,  Node: 21.1.,  Next: 21.2.,  Up: 21. Gnuserv
  811.  
  812. 21.1. How do I disable gnuserv from opening a new frame?
  813. ========================================================
  814.  
  815.    If you set the gnuserv-screen variable to the frame that should be
  816. used to display buffers that are pulled up, a new frame will not be
  817. created. For example, you could put
  818.  
  819.      (setq gnuserv-screen (selected-frame))
  820.  
  821.    early on in your `.emacs', to ensure that the first frame created is
  822. the one used for your gnuserv buffers.
  823.  
  824. 
  825. File: xemacs-faq.info,  Node: 21.2.,  Prev: 21.1.,  Up: 21. Gnuserv
  826.  
  827. 21.2.  What do I do to start the gnuserv server so that each subseqeuent XEmacs is a client?
  828. ============================================================================================
  829.  
  830.    Put the following in your `.emacs' file to start the server:
  831.  
  832.      (gnuserv-start)
  833.  
  834.    Start your first XEmacs as usual.  After that, you can do
  835.  
  836.      gnuclient randomfilename
  837.  
  838.    from the command line to get your existing XEmacs process to open a
  839. new frame and visit randomfilename in that window. When you're done
  840. editing randomfilename, hit `C-x #' to kill the buffer and get rid of
  841. the frame.
  842.  
  843. 
  844. File: xemacs-faq.info,  Node: 22. Miscellaneous,  Prev: 21. Gnuserv,  Up: Top
  845.  
  846. 22. Miscellaneous
  847. *****************
  848.  
  849. * Menu:
  850.  
  851. * 22.1.::          22.1. How do I specify the paths that XEmacs uses for finding files?
  852. * 22.2.::          22.2. Why does edt emulation not work?
  853. * 22.3.::          22.3. How can I emulate VI and use it as my default mode?
  854. * 22.4.::          22.4. Is there some way to get the behavior so that if the current buffer has a file associated with it, the current buffer will use that files name else use the buffer name?
  855. * 22.5.::          22.5. I have no idea where this is coming from, but ever since I moved from 19.9 to 19.13 I have started seeing that all of my buffers will get a minor mode called `Omit'.  I have no idea how it got there nor do I know what it does.  What is it?
  856. * 22.6.::          22.6. How do I turn off the sound?
  857. * 22.7.::          22.7. Can I have the end of the buffer delimited in some way? Say, with:   [END] ?
  858. * 22.8.::          22.8. Can I insert today's date into buffer?
  859. * 22.9.::          22.9. Are only certain syntactic character classes available for abbrevs?  I didn't see any restrictions in the info.
  860. * 22.10.::         22.10. Filladapt used to work after I loaded it.  Now in 19.13 it doesn't.  What gives?
  861.  
  862. 
  863. File: xemacs-faq.info,  Node: 22.1.,  Next: 22.2.,  Up: 22. Miscellaneous
  864.  
  865. 22.1. How do I specify the paths that XEmacs uses for finding files?
  866. ====================================================================
  867.  
  868.    You can specify what paths to use by using a number of different
  869. flags when running configure.  See the section MAKE VARIABLES in the
  870. top-level file INSTALL in the XEmacs distribution for a listing of
  871. those flags.
  872.  
  873.    Most of the time, however, the simplest fix is: DO NOT specify paths
  874. as you might for FSF GNU Emacs.  XEmacs can generally determine the
  875. necessary paths dynamically at run time.  The only path that generally
  876. needs to be specified is the root directory to install into.  That can
  877. be specified by passing the `--prefix' flag to configure.  For a
  878. description of the XEmacs install tree, please consult the NEWS file.
  879.  
  880. 
  881. File: xemacs-faq.info,  Node: 22.2.,  Next: 22.3.,  Prev: 22.1.,  Up: 22. Miscellaneous
  882.  
  883. 22.2. Why does edt emulation not work?
  884. ======================================
  885.  
  886.    We don't know, but you can use tpu-edt emulation instead, which
  887. works fine and is a little fancier than the standard edt emulation.  To
  888. do this, add the following line to your `.emacs':
  889.  
  890.      (load "tpu-edt")
  891.  
  892.    If you don't want it to replace Ctrl-h with edt-style help menu add
  893. this as well:
  894.  
  895.      (global-set-key '(control h) 'help-for-help)
  896.  
  897. 
  898. File: xemacs-faq.info,  Node: 22.3.,  Next: 22.4.,  Prev: 22.2.,  Up: 22. Miscellaneous
  899.  
  900. 22.3. How can I emulate VI and use it as my default mode?
  901. =========================================================
  902.  
  903.    Our recommended VI emulator is viper.  To put the current buffer into
  904. viper-mode, use the command:
  905.  
  906.      M-x viper
  907.  
  908.    To make viper-mode the default, add the following lines to your
  909. `.emacs':
  910.  
  911.      (load-library "viper")
  912.      (setq term-setup-hook 'viper)
  913.      (setq find-file-hooks 'viper)
  914.      (setq find-file-not-found-hooks 'viper)
  915.  
  916. 
  917. File: xemacs-faq.info,  Node: 22.4.,  Next: 22.5.,  Prev: 22.3.,  Up: 22. Miscellaneous
  918.  
  919. 22.4. Is there some way to get the behavior so that if the current buffer has a file associated with it, the current buffer will use that files name else use the buffer name?
  920. ==============================================================================================================================================================================
  921.  
  922.    Just set frame-title-format from find-file-hooks.  Alternatively,
  923. look at the answer to question 15.2.
  924.  
  925.    In addition, one could set modeline-format.
  926.  
  927. 
  928. File: xemacs-faq.info,  Node: 22.5.,  Next: 22.6.,  Prev: 22.4.,  Up: 22. Miscellaneous
  929.  
  930. 22.5. I have no idea where this is coming from, but ever since I moved from 19.9 to 19.13 I have started seeing that all of my buffers will get a minor mode called `Omit'.  I have no idea how it got there nor do I know what it does.  What is it?
  931. =====================================================================================================================================================================================================================================================
  932.  
  933.    It's part of dired.  In dired, you can type M-o to get Omit mode and
  934. that will ignore uninteresting files (checkpoint files and backups, for
  935. example).  You get Omit in the modeline everywhere because the variable
  936. `dired-omit-files-p' is globally set to some non-nil value.  If you
  937. want this functionality, it's probably best to use a hook:
  938.  
  939.      (add-hook 'dired-after-readin-hook '(lambda () (dired-omit-toggle)))
  940.  
  941.    Alternatively, since  it seems odd to toggle the omit state with
  942. every readin, since readin can happen many times in a Dired buffer, you
  943. can try this hook to correct the "Omit" problem:
  944.  
  945.      (add-hook 'dired-mode-hook
  946.        (function (lambda ()
  947.            ;; `dired-omit-files-p' is made buffer-local by "dired-x.el", but
  948.            ;; maybe not soon enough.
  949.                  (make-local-variable 'dired-omit-files-p)
  950.                  (setq dired-omit-files-p t))))
  951.  
  952.    This is only run once, when the Dired buffer is created.
  953.  
  954. 
  955. File: xemacs-faq.info,  Node: 22.6.,  Next: 22.7.,  Prev: 22.5.,  Up: 22. Miscellaneous
  956.  
  957. 22.6. How do I turn off the sound?
  958. ==================================
  959.  
  960.    Add the following line to your `.emacs' file:
  961.  
  962.      (setq bell-volume 0)
  963.      (setq sound-alist nil)
  964.  
  965. 
  966. File: xemacs-faq.info,  Node: 22.7.,  Next: 22.8.,  Prev: 22.6.,  Up: 22. Miscellaneous
  967.  
  968. 22.7. Can I have the end of the buffer delimited in some way? Say, with:   [END] ?
  969. ==================================================================================
  970.  
  971.      (make-annotation "[END]" (point-max) 'text (current-buffer))
  972.  
  973.    Note that you might want to put this in a hook.
  974.  
  975.    You might also need:
  976.  
  977.      (require 'annotations)
  978.  
  979.    since `make-annotation' is not defined by default.
  980.  
  981. 
  982. File: xemacs-faq.info,  Node: 22.8.,  Next: 22.9.,  Prev: 22.7.,  Up: 22. Miscellaneous
  983.  
  984. 22.8. Can I insert today's date into buffer?
  985. ============================================
  986.  
  987.    Use this lisp in a function:
  988.  
  989.      (insert (current-time-string))
  990.  
  991. 
  992. File: xemacs-faq.info,  Node: 22.9.,  Next: 22.10.,  Prev: 22.8.,  Up: 22. Miscellaneous
  993.  
  994. 22.9. Are only certain syntactic character classes available for abbrevs?  I didn't see any restrictions in the info.
  995. =====================================================================================================================
  996.  
  997.    Yes, abbrevs only expand word-syntax strings.  So, in c-mode if you
  998. wanted to expand something to `define ', you would be able to expand
  999. `xd' but not `#d'.
  1000.  
  1001. 
  1002. File: xemacs-faq.info,  Node: 22.10.,  Prev: 22.9.,  Up: 22. Miscellaneous
  1003.  
  1004. 22.10.  Filladapt used to work after I loaded it.  Now in 19.13 it doesn't.  What gives?
  1005. ========================================================================================
  1006.  
  1007.    Filladapt 2.x is included in 19.13+.  In it filladapt is now a minor
  1008. mode and minor modes are traditionally off by default.  The following
  1009. added to your .emacs will turn it on for all buffers:
  1010.  
  1011.      (setq-default filladapt-mode t)
  1012.  
  1013.    Use `turn-on-filladapt-mode' to turn Filladapt on in particular
  1014. major modes, like this:
  1015.  
  1016.      (add-hook 'text-mode-hook 'turn-on-filladapt-mode)
  1017.  
  1018.  
  1019.